import {CHANGE_INPUT_VALUE,ADD_ITEM,DELETE_ITEM,Init_DATA_LIST,REDUX_SAGA_GET_DATA_LIST} from './ActionTypes'
//import axios from 'axios'
//所有方法返回action
export const getInputChangeAction = (value) =>{
    return {
        type:CHANGE_INPUT_VALUE,
        value
    }
}
export const getAddItemAction = () =>{
    return {
        type:ADD_ITEM,
    }
}
export const getDeleteItemAction = (index) =>{
    return {
        type:DELETE_ITEM,
        index
    }
}
export const getInitDataList = (data) =>{
    return {
        type:Init_DATA_LIST,
        data
    }
}
export const getInitDataListBySaga = () =>{
    return {
        type:REDUX_SAGA_GET_DATA_LIST,
    }
}
// export const getDataList = (id) => {
//     return (dispatch) =>{
//         console.log(id);
//         axios.get('http://127.0.0.1:3002/getAllUser').then((res)=>{
//             console.log(res.data.message);
//             var data = [1,2,3];
//             //console.log(data);
//             var action = getInitDataList(data);
//             dispatch(action);
//         });
//     }
// }